
const initChannels = {
  goodslist: [],
  channels: []
}
function reducer(state = initChannels, action) {
  let newState = JSON.parse(JSON.stringify(state))
  console.log(111, action);
  switch (action.type) {
    case "CLLOOCT":
      {
        newState.goodslist.push(action.params)
      }
      break
    case 'CANCElCLLOOCT':
      {
        console.log(44, action);
        let index = newState.goodslist.findIndex(item => {
          return item.id === action.params.id
        })

        if (index != -1) {
          newState.goodslist.splice(index, 1)
        }
      }
      break
  }
  return newState
}
export default reducer